# -*- coding: utf-8 -*-

import logging
from service import Service


class LoginService(Service):
    SERVICE_ID = 2000

    def __init__(self):
        super(LoginService, self).__init__(LoginService.SERVICE_ID)
        commands = {
            1001 : self.handleLogin,
            1002 : self.handleLogout,
        }
        self.registers(commands)

    def handleLogin(self, msg):
        logging.debug('login from %s', msg)
        return msg

    def handleLogout(self, msg):
        logging.debug('logout from %s', msg)
        return msg